package com.itheima.pojo;

/**
 * 枚举使用方法
 * ①构造私有化
 * ②提供属性get/set方法
 */
public enum CommonCodeEnum implements Code{
   SUCCESS(1,"成功"),
   ERROR(0,"失败");


    private Integer code;

    private String msg;

    /**
     * 枚举的构造器本身就是私有的
     * @param code 响应码
     * @param msg 响应描述
     */
    CommonCodeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMsg() {
        return this.msg;
    }
}
